<?php
/**
 * This file is part of webman.
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the MIT-LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @author    walkor<walkor@workerman.net>
 * @copyright walkor<walkor@workerman.net>
 * @link      http://www.workerman.net/
 * @license   http://www.opensource.org/licenses/mit-license.php MIT License
 */

use Webman\Route;

//关闭默认路由
//Route::disableDefaultRoute();

//更改默认路由
Route::get('/', function (){
    return json(['code' => 0, 'msg' => 'ok', 'result'=>[]]);
});

Route::fallback(function(){
    $request = request();
    $request->allParam = $request->all();
    $request->startExceTime = microtime(true);

    throw new \app\exception\IndexException(404,'404 not found');
    //return json(['code' => 404, 'msg' => '404 not found', 'result'=>[]]);
});

//Route::get('/index/autoroute', [\app\controller\IndexController::class, 'autoRoute']);
//
////系统自动生成路由
//if(is_file(runtime_path('routes/web.php'))){
//    include_once runtime_path('routes/web.php');
//}





